package com.dwork.base.controller.scanning;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;


public class Test {
	 public static void main(String[] args) {
	        List<Class<?>> classesList = null;
	      //  classesList = AnnoManageUtil.getPackageController("com.dwork.base.controller", Controller.class);
	        Map<String, ExecutorBean> mmap = new HashMap<String, ExecutorBean>();
	       // AnnoManageUtil.getRequestMappingMethod(classesList, mmap);
	        

	       try {
	        	mmap=AnnoManageUtil.getRequestMappingMethod("com.dwork.base.controller");
	        	  Iterator<Map.Entry<String, ExecutorBean>> it = mmap.entrySet().iterator();  
	        	  while (it.hasNext()) {  
	        	   Map.Entry<String, ExecutorBean> entry = it.next();  
	        	   ExecutorBean bean = mmap.get(entry.getKey());
	        	   bean.getMethod().invoke(bean.getObject());
	        	   Tagg annotation = bean.getMethod().getAnnotation(Tagg.class);
	        	   System.out.println("注解名称：" + annotation.name() + "\t注解描述：" + annotation.description()+annotation.value());
	        	  }  
		       
		       // ExecutorBean bean = mmap.get("/test2");
	            //bean.getMethod().invoke(bean.getObject());
	          //  RequestMapping annotation = bean.getMethod().getAnnotation(RequestMapping.class);
	            //System.out.println("注解名称：" + annotation.name() + "\t注解描述：" + annotation.description()+annotation.value());
	       } catch (IllegalAccessException e) {
	           e.printStackTrace();
	      } catch (InvocationTargetException e) {
	           e.printStackTrace();
	      }
	    }
	}
